package userdao;

import java.awt.*;
import javax.swing.*;

public class TestLogin {
    JFrame jf = new JFrame("[欢迎进入银行自助系统]");
    JLabel lb0 = new JLabel("     银 行 自 助 终 端");
    JLabel lb1 = new JLabel("用       户      名:");
    JLabel lb2 = new JLabel(" 密            码:");


    /*
     * 加载背景图片
     */


    ImageIcon background = new ImageIcon("D:\\IDEA.flle\\JDBC\\Test\\src\\JDBCUI\\image.jpg");
    JLabel label = new JLabel(background);
    protected JTextField jt1 = new JTextField(15);
    protected JPasswordField jt2 = new JPasswordField(15);
    JButton btn1 = new JButton("登 陆");
    JButton btn2 = new JButton("重 置");
    JButton btn3 = new JButton("开 户");

    public void init() {
        /*
         * 设置标签大小
         */

        label.setBounds(0, 0, background.getIconWidth(), background.getIconHeight());

        /*
         * 主界面获得容器JPanel
         */

        jf.getLayeredPane().add(label, new Integer(Integer.MIN_VALUE));
        JPanel jp = (JPanel) jf.getContentPane();

        /*
         * JPanel对象才可以调用setOpaque(false);设置是否透明
         */

        jp.setOpaque(false);
        JPanel jpanel = new JPanel();
        jpanel.setOpaque(false);

        /*
         * 去除JPanel默认布局方式,以实现各个控件自己的定位
         */

        jpanel.setLayout(null);

        lb0.setForeground(Color.YELLOW);
        lb0.setBounds(198, 5, 200, 30);
        lb1.setBounds(80, 50, 140, 30);
        lb2.setBounds(80, 100, 140, 30);
        jt1.setBounds(188, 50, 180, 23);
        jt2.setBounds(188, 100, 180, 23);
        btn1.setBounds(80, 180, 100, 25);
        btn2.setBounds(180, 180, 100, 25);
        btn3.setBounds(280, 180, 100, 25);

        jpanel.add(lb0);
        jpanel.add(lb1);
        jpanel.add(lb2);
        jpanel.add(btn1);
        jpanel.add(btn2);
        jpanel.add(btn3);
        jpanel.add(jt1);
        jpanel.add(jt2);

        jf.add(jpanel);
        jf.setBounds(460, 260, 500, 300);
        jf.setVisible(true);
    }

    public static void main(String[] args) {
        new TestLogin().init();
    }
}